import React,{ useEffect, useState} from 'react'
import { Breadcrumb } from 'antd';
import { useLocation } from 'react-router-dom';
export default function Bread() {
    const [breadName,setBreadName] = useState('')
    const {pathname} = useLocation()
    useEffect(()=>{
        switch(pathname){
            case "/list":
                setBreadName('查看文章列表列表');
                break;
            case "/listtable":
                setBreadName('查看文章表格表格表格');
                break;
            case "/edit":
                setBreadName('文章编辑');
                break;
            case "/means":
                setBreadName('修改资料');
                break;
                default:
                    break;
        }
    },[pathname])
  return (
    <Breadcrumb>
    <Breadcrumb.Item  href='/'>首页</Breadcrumb.Item>
    <Breadcrumb.Item>
      {breadName}
    </Breadcrumb.Item>
  </Breadcrumb>
  )
}
